/*
 * Copyright (C) 2010 Graham Allan
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package edu.strath.cis.grallan.findbugs.adaptiveranking.gui;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public final class LearningHelpInfo extends AbstractHelpInfo {

	@Override
	protected String makeBriefInformationString() {
		return "Learning Mode is intended to be used when you've performed the first analysis "
				+ "of a large codebase. The problem with this scenario is that it can be hard to know where "
				+ "to start if you have thousands of alerts. The goal of the Learning Mode is to get you to "
				+ "classify bugs in the order which will give the Adaptive Ranking Mode the most information. "
				+ "The Learning Mode should be used when you first start to analyse a large codebase, or the "
				+ "highest ranking in the Adaptive Ranking Mode is 0.";
	}

	@Override
	protected String makeModeNameString() {
		return "Learning Mode";
	}

	protected List<IQuestionAndAnswer> makeFaqs() {
		QuestionAndAnswer infoUsed = new QuestionAndAnswer("What information does this mode use?",
				"This mode uses correlation factors between bugs to pick those that will give the most "
						+ "information about the other alerts in the analysis.");
		QuestionAndAnswer howToUse = new QuestionAndAnswer(
				"How do I use this mode?",
				"The best way to use this mode is to classify alerts in order, then switch to the Adaptive "
						+ "Ranking Mode when you have found a few bugs you wish to fix. If several alerts in a row appear "
						+ "very similar to you, refresh the order.");
		QuestionAndAnswer howItCalculates = new QuestionAndAnswer(
				"How does it calculate the rank for each bug?",
				"Learning Mode uses the correlation factors between the bugs reported for your codebase, as "
						+ "well as the current Adaptive Ranking value. The correlating factors give an idea of how much "
						+ "information a bug will give about the rest of the codebase if classified.");
		QuestionAndAnswer howToInterpret = new QuestionAndAnswer(
				"How should I interpret the rank given to each bug alert?",
				"The Learning rank represents how much information the bug will give if classified, the higher "
						+ "the value the more it will tell you about other bug alerts. The actual value for the Learning "
						+ "rank is pretty meaningless when viewed in isolation. What is important is the ordering that the "
						+ "rank from all the bugs provides.");
		List<IQuestionAndAnswer> newFaqs = new ArrayList<IQuestionAndAnswer>();
		newFaqs.add(infoUsed);
		newFaqs.add(howToUse);
		newFaqs.add(howItCalculates);
		newFaqs.add(howToInterpret);
		return Collections.unmodifiableList(newFaqs);
	}
}